<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;

        }

        .box1{
            color: red;
        }
    </style>
</head>
<body>
    <div class="box" id="root">Hello</div>

    <script>
        var root=document.getElementById("root");
        root.id="roots";
         //console.log(root.id);
         

         root.className="boxs box1 ";
         //console.log(root.className);

         console.log(root.classList.add("mybox"));
         root.classList.remove("box");
         if(root.classList.contains("box1")){
            console.log("有");
         }else{
            console.log("没有");
         }

         console.log(root.innerHTML="大家好啊");
         console.log(root.innerText="别关");

         var str="<a herf='https://www.itbaizhan.com'>baizhan</a>";
         root.innerHTML=str
    </script>
</body>
</html>